Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX JS Console errors and warnings #1698

Conversation

sabina-talipova
Copy link
Contributor

@sabina-talipova sabina-talipova commented Mar 4, 2024

Description

SearchableDropdownField was tested with LinkField, Elemental and simply on a Page. There are not any related errors or warnings in dev or prod.

Parent issue

@sabina-talipova sabina-talipova force-pushed the pulls/2/fix-js-console-errors branch 2 times, most recently from 19edaaf to aa8c60a Compare March 4, 2024 22:20
@sabina-talipova sabina-talipova marked this pull request as ready for review March 4, 2024 22:25
this.setComponent(ReactField);
this._super();
this.refresh();
if (schema) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In first load Entwine this.data('schema') method returns null.

@@ -166,12 +166,12 @@ SearchableDropdownField.propTypes = {
multi: PropTypes.bool.isRequired,
name: PropTypes.string.isRequired,
placeholder: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
onChange: PropTypes.func,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this method is always required. This recommendation gives advice to use defaultProps instead of isRequired if we are not sure that this value will be provided.

options: PropTypes.arrayOf(PropTypes.object),
optionUrl: PropTypes.string,
passRef: PropTypes.bool.isRequired,
searchable: PropTypes.bool.isRequired,
value: PropTypes.any.isRequired,
Copy link
Contributor Author

@sabina-talipova sabina-talipova Mar 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here as well. We don't have any values in a new field and pass value as null.

@sabina-talipova sabina-talipova force-pushed the pulls/2/fix-js-console-errors branch from aa8c60a to 1df1ee7 Compare March 4, 2024 23:13
Copy link
Member

@GuySartorelli GuySartorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please retarget to 2.2 since this is a bug that should be resolved prior to tagging 5.2.0 stable
  2. There is still no formfield displaying. A field should be displayed (that's the main thing the issue is about - the console errors were just added to help diagnose what's causing the problem)

I haven't looked at the actual code yet, just tried locally and saw that the form field still doesn't display.

@sabina-talipova sabina-talipova deleted the pulls/2/fix-js-console-errors branch March 5, 2024 03:34
@sabina-talipova
Copy link
Contributor Author

Close in favour of #1699

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants